package com.zxp.cloud.ums.controller;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author shollin
 * @desc
 * @date 2021/7/18/018 9:40
 */
@RestController
@RequiredArgsConstructor
@Slf4j
@RefreshScope
public class UmsController {

    @Value("${author:}")
    public String author;

    private final RestTemplate restTemplate;

    @GetMapping("/")
    public String index(){
        return "ums hello:"+author;
    }

    @GetMapping("/sayHello")
    public String sayHello(String name){
        return name +" say hello!";
    }
}
